feat(protect): opt-in response screening for node/express + Supabase guard#64
Merged
Conversation
examples/protect/ — a runnable Verified Vulnerability Shielding demo against a REAL vulnerable dependency (lodash@4.17.11, CVE-2019-10744): exploit works unprotected → dry-run detects → block rejects the request before the sink → benign still served → response AWS-key redaction → egress SSRF block → proof line. No app redeploy, no token. rules.demo.json holds EXAMPLE rules for public CVEs only (clearly labeled) — NOT the production corpus, which is fetched per-site from the API at runtime. No secrets in-repo. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…guard
Extend Tier-3 response-phase screening (secret-leak redaction / withhold)
beyond the fetch() path to the remaining server surfaces:
- runtime: expose `screenResponse(response)`; wire `{ screenResponses: true }`
into node() and express() (buffers the outgoing body, then redacts spans or
withholds via the response rules). Opt-in — buffering can delay a stream, and
bodies over 512 KiB pass through unscanned. fetch() now shares the same
screenResp() closure.
- supabase-guard: screen the forwarded upstream response through
protection.screenResponse (query results can leak secrets/PII). Fails open.
- types: add screenResponse + the screenResponses option; +8 tests
(tests/protect/response-guards.test.ts) covering node/express/Supabase
redact, block-withhold, non-text passthrough, dry-run, and opt-in gating.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Introduces robust opt-in response screening across fetch, Express, Node, and Supabase. 🎯 Quality: 86% Excellent · 📦 Size: Medium 📈 This month: Your 26th PR — above team average · Averaging Excellent |
…ash) Pins lodash@4.17.11 so the end-to-end demo reproducibly installs the exact version CVE-2019-10744 targets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
/review |
ejntaylor
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #61 (
feat/protect-demo).Completes Tier-3 response-phase screening across all server surfaces — until now, secret-leak redaction / withhold only ran on the
fetch()path.What changed
screenResponse(response)and wires a{ screenResponses: true }option intonode()andexpress(). When set, the adapter buffers the outgoing body and runs it through the response rules — redacting the offending spans or withholding (500). Opt-in, because buffering can delay a streamed response; bodies over 512 KiB pass through unscanned.fetch()now shares the samescreenResp()closure.protection.screenResponse(query results can leak secrets/PII). Fails open if unavailable.screenResponse+ thescreenResponsesoption added toprotect.d.ts.Tests
tests/protect/response-guards.test.ts(+8): node/express/Supabase redact, block→withhold (500), non-text passthrough, dry-run observe-only, and opt-in gating (no screening unless requested). Full suite 366 pass, typecheck + build clean.🤖 Generated with Claude Code